public async Task <int> AddAsync(Accommodation accommodation)
        {
            var dataModel = new Models.Accommodation
            {
                FacilityId  = accommodation.FacilityId,
                Name        = accommodation.Name,
                Description = accommodation.Description,
                RoomCount   = accommodation.RoomCount,
                Images      = accommodation.Images.ToJson()
            };

            await context.Accommodations.AddAsync(dataModel);

            return(dataModel.Id);
        }
Exemple #2
0
 public Accommodation MapFrom(Models.Accommodation accommodation)
 {
     return(Mapper.Map <Accommodation>(accommodation));
 }