Exemplo n.º 1
0
        public override async Task <ActionResult> HandleAsync(Guid id, CancellationToken cancellationToken = default)
        {
            await _repo.DeleteClosetAsync(id);

            await _repo.SaveAsync();

            return(Ok());
        }
Exemplo n.º 2
0
        public override async Task <ActionResult> HandleAsync([FromBody] CreateClosetRequest request, CancellationToken cancellationToken = default)
        {
            var Closet = new Closet
            {
                Id          = request.Id,
                RoomId      = request.RoomId,
                BuildingId  = request.BuildingId,
                CarpetId    = request.CarpetId,
                CarpetPrice = request.CarpetPrice,
                Length      = request.Length,
                Width       = request.Width
            };
            await _repo.AddAsync(Closet);

            await _repo.SaveAsync();

            return(Ok(Closet));
        }