I have created a MealMapper just like bellow, but now im having other problems related to how search data in the repo and how to save it correctly:
public class MealMapper : Mapper<Meal, MealInput>
public override Meal MapToEntity(MealInput input, Meal e)
var entity = base.MapToEntity(input, e);
var list = IoC.Resolve<IDelRepo<User>>().Where(o => o.Login.Equals(HttpContext.Current.User.Identity.Name)).GetEnumerator();
var user = list.Current;
//entity.User = user;
entity.UserId = user.Id;
I had added the following to the WindsorConfigurator:
WindsorRegistrar.Register(typeof(IMealService), typeof(MealService)); // this line was already there ;D
WindsorRegistrar.Register(typeof(IMapper<Meal, MealInput>), typeof(MealMapper));
Got this error message: "New transaction is not allowed because there are other threads running in the session."
After a lot of hours trying to understand Im came here to ask: how is the best way to search data in the repo, and how can i save the Meal with my new Complex property?