Search Results

Search found 3 results on 1 pages for 'nakchak'.

Page 1/1 | 1 

  • Can i Automap a tree heirarchy with fluent nhibernate?

    - by NakChak
    Is it possible to auto map a simple nested object structure? Something like this public class Employee : Entity { public Employee() { this.Manages = new List<Employee>(); } public virtual string FirstName { get; set; } public virtual string LastName { get; set; } public virtual bool IsLineManager { get; set; } public virtual Employee Manager { get; set; } public virtual IList<Employee> Manages { get; set; } } Causes the following error at run time: Repeated column in mapping for collection: SharpKtulu.Core.Employee.Manages column: EmployeeFk Is it possible to automap this sort of structure, or do i have over ride the auto mapper for this sort of structure?

    Read the article

  • Can I Automap a tree hierarchy with Fluent NHibernate?

    - by NakChak
    Is it possible to auto map a simple nested object structure? Something like this: public class Employee : Entity { public Employee() { this.Manages = new List<Employee>(); } public virtual string FirstName { get; set; } public virtual string LastName { get; set; } public virtual bool IsLineManager { get; set; } public virtual Employee Manager { get; set; } public virtual IList<Employee> Manages { get; set; } } It causes the following error at run time: Repeated column in mapping for collection: SharpKtulu.Core.Employee.Manages column: EmployeeFk Is it possible to automap this sort of structure, or do I have override the auto mapper for this sort of structure?

    Read the article

  • Circular Reference exception with JSON Serialisation with MVC3 and EF4 CTP5w

    - by nakchak
    Hi I'm having problems with a circular reference when i try and serialise an object returned via EF4 CTP5. Im using the code first approach and simple poco's for my model. I have added [ScriptIgnore] attributes to any properties that provide a back references to an object and annoyingly every seems to work fine if i manually instantiate the poco's, i.e. they serialise to JSON fine, and the scriptignore attribute is acknowledged. However when i try and serialise an object returned from the DAL i get the circular reference exception "A circular reference was detected while serializing an object of type 'System.Data.Entity.DynamicProxies.xxxx'" I have tried several ways of retreiving the data but they all get stuck with this error: public JsonResult GetTimeSlot(int id) { TimeSlotDao tsDao = new TimeSlotDao(); TimeSlot ts = tsDao.GetById(id); return Json(ts); } The method below works slightly better as rather than the timeslot dynamic proxied object causing the circular refference its the appointment object. public JsonResult GetTimeSlot(int id) { TimeSlotDao tsDao = new TimeSlotDao(); var ts = from t in tsDao.GetQueryable() where t.Id == id select new {t.Id, t.StartTime, t.Available, t.Appointment}; return Json(ts); } Any ideas or solutions to this problem? Update I would prefer to use the out of the box serialiser if possible although Json.Net via nuget is ok as an alternative i would hope its possible to use it as I intended as well...

    Read the article

1