// TODO: add Include private async Task <EntityRoomType> Get(IRoomTypeContainer room) { if (room == null) { throw new ArgumentNullException(nameof(room)); } if (room.RoomTypeId.HasValue) { return(await this.Context.RoomTypes.AsNoTracking().FirstOrDefaultAsync(x => x.Id == room.RoomTypeId)); } return(null); }
public async Task DeleteAsync(IRoomTypeContainer model) { Context.RoomTypes.Remove(Mapper.Map <EntityRoomType>(model)); await Context.SaveChangesAsync(); }
public async Task <DomainRoomType> GetByAsync(IRoomTypeContainer model) { var res = await Get(model); return(Mapper.Map <DomainRoomType>(res)); }