示例#1
0
        // 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);
        }
示例#2
0
 public async Task DeleteAsync(IRoomTypeContainer model)
 {
     Context.RoomTypes.Remove(Mapper.Map <EntityRoomType>(model));
     await Context.SaveChangesAsync();
 }
示例#3
0
        public async Task <DomainRoomType> GetByAsync(IRoomTypeContainer model)
        {
            var res = await Get(model);

            return(Mapper.Map <DomainRoomType>(res));
        }