public static Lunch ToEntity(this LunchContract lunch) { return(new Lunch { Id = lunch.Id, LunchTime = lunch.LunchTime, RestaurantId = lunch.RestaurantId, Employees = lunch.Employees?.ToEntities(), Restaurant = lunch.Restaurant?.ToEntity(), }); }
public IHttpActionResult Post(LunchContract lunchContract) { return(_lunchHandler.Post(lunchContract) ? (IHttpActionResult)Ok() : BadRequest()); }
public bool Post(LunchContract lunchContract) { return(_uow.LunchRepository.CreateOrUpdate(lunchContract.ToEntity())); }