Exemplo n.º 1
0
        public ActionResult Delete(int id)
        {
            if (!_service.Delete(id, out var deletedCommand))
            {
                return(NotFound());
            }

            return(Ok(deletedCommand));
        }
Exemplo n.º 2
0
        public static int Delete <T>(this IQueryable <T> queryable)
            where T : class
        {
            // Resolve service
            var serviceFactory = new ServiceFactory <T>(queryable);
            ICommandService <T> commandService = serviceFactory.CreateCommandService();

            // Execute Query
            var query = new DeleteStatement <T>(IQueryableHelper.GetQueryPredicate(queryable));

            return(commandService.Delete(query));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Delete(Guid id)
        {
            var success = await _services.Delete(id);

            return(success ? Ok() : NotFound() as IActionResult);
        }
Exemplo n.º 4
0
        public static ICommandResponse <T> Delete <T>(this ICommandService <T> service, string id) where T : class, new()
        {
            ICommandContext <T> context = new CommandContext <T>().Delete(id);

            return(service.Delete(context).Response);
        }