Exemplo n.º 1
0
        public Response <bool> SetStatus <T>(IdRequest request, bool isActive) where T : DeletableEntity
        {
            var setActive = new SetActiveStatusRequest <T> {
                Id = request.Id, IsActive = isActive
            };

            return(SetStatus(setActive));
        }
Exemplo n.º 2
0
        public virtual Response <bool> SetStatus(SetActiveStatusRequest <TEntity> request)
        {
            var response = new Response <bool>();

            if (request.IsRequestInvalid(response, ContextInfo))
            {
                return(response);
            }

            return(SetStatus <TEntity>(request));
        }
Exemplo n.º 3
0
        public virtual Response <bool> SetStatus <T>(SetActiveStatusRequest <T> request) where T : DeletableEntity
        {
            Logger.LogTrace($"Entering SetStatus for {typeof(T).Name} for id: {request.Id} set it to {request.IsActive}. By user {Username}");
            var response = new Response <bool>();

            if (request.IsRequestInvalid(response, ContextInfo))
            {
                return(response);
            }

            var command = new SetEntityIsActiveCommand <T>
            {
                WrappedRequest = WrapRequest(request)
            };
            var result = Repository.ExecuteCommand(command);

            response.Merge(result);

            return(response);
        }