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

            return(Ok(deletedCommand));
        }
Beispiel #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));
        }
Beispiel #3
0
        public async Task <IActionResult> Delete(Guid id)
        {
            var success = await _services.Delete(id);

            return(success ? Ok() : NotFound() as IActionResult);
        }
Beispiel #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);
        }