예제 #1
0
        public Response DeleteByID(long id)
        {
            Response response = new Response();

            try
            {
                Processor.Delete(id);
                response.Text   = $"Entity with id {id} was successfully removed from the system.";
                response.Result = true;
            }
            catch
            {
                response.Text   = "Unfortunately something went wrong. Are you sure the entity you are trying to delete exists ?";
                response.Result = false;
            }
            return(response);
        }
예제 #2
0
        /// <summary>
        /// Function to delete entities .
        /// </summary>
        /// <param name="idList">entities id</param>
        /// <returns>response</returns>
        public ApiResponse Delete(List <long> idList)
        {
            ApiResponse response = new ApiResponse();

            try
            {
                Processor.Delete(idList);
                response.Text   = "The entity was successfully removed . \n";
                response.Result = true;

                return(response);
            }
            catch (Exception ex)
            {
                response.Result = false;
                response.Text   = ex.Message;

                return(response);
            }
        }
        public ApiResponse DeleteById(long id)
        {
            UserProcessor = new UserProcessor();
            Response      = new ApiResponse();

            try
            {
                UserProcessor.Delete(id);
                Response.text   = "Entity was successfully removed from the system.";
                Response.result = true;

                return(Response);
            }
            catch
            {
                Response.text   = "Unfortunately something went wrong :(";
                Response.result = false;

                return(Response);
            }
        }
        public ApiResponse Delete(List <long> idList)
        {
            UserProcessor = new UserProcessor();
            Response      = new ApiResponse();

            try
            {
                UserProcessor.Delete(idList);
                Response.text   = "Entity was successfully removed from the system.";
                Response.result = true;

                return(Response);
            }
            catch
            {
                Response.text   = "Unfortunately something went wrong. Try again later. :)";
                Response.result = false;

                return(Response);
            }
        }
예제 #5
0
 public void Delete(int id)
 {
     userProcessor.Delete(id);
 }
예제 #6
0
 public void DeleteUser(long id)
 {
     userProcessor.Delete(id);
 }