I have created Enum class of LeaveReason in data access layer having values sick leave,planned leave or other reason now i want to call this enum class to my custom type layer but how to call it ???
please help as i am new in c#…
here is my code looks like…..
In Data Access layer :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Sherserve.DataAccessLayer
{
public enum LeaveReason
{
Sick,
Planned,
Other
}
}
In Data Custom Type layer :
Now i want to access enum class which i created in data access layer in custom type layer.
You can see i have added reference of data access layer but it is showing error..
please correct this and tell me how i can call enum class in custom type layer.
using System;
using System.Collections.Generic;
using System.Text;
using Sherserve.DataAccessLayer;
namespace Sherserve.CustomTypeLayer
{
public class EmployeeLeave
{
public LeaveReason LeaveType { get; set; }
public int EmployeeId { get; set; }
public DateTime DateFrom { get; set; }
public DateTime DateTo { get; set; }
public string Reason { get; set; }
}
}
my problem is that i am un able to call enum class from data access to custom type and also i am unable to add reference of data access class to custom type…
please guide me properly..
thanks
You need to add a reference to the
Sherserve.DataAccessLayerin theSherserve.CustomTypeLayer. Typically theSherserve.CustomTypeLayerwould be a class library project that its output is a .dll file that you add to the other dataaccess layer from references -> add reference.