public async Task <OperationResult <string> > AddPostManagazinAsync(PostMagazine postMagazine, CancellationToken cancellationToken) { try { await context.AddAsync(postMagazine, cancellationToken); return(OperationResult <string> .BuildSuccessResult("Success Add Post")); } catch (Exception ex) { return(OperationResult <string> .BuildFailure(ex.Message)); } }
public async Task <OperationResult <string> > AddAsync(UserRole userRole, CancellationToken cancellation) { try { await context.AddAsync(userRole, cancellation); return(OperationResult <string> .BuildSuccessResult("Add Success")); } catch (Exception ex) { return(OperationResult <string> .BuildSuccessResult(ex.Message)); } }
public async Task <OperationResult <string> > AddCategoryAsync(Category category, CancellationToken cancellation) { try { await context.AddAsync(category, cancellation); return(OperationResult <string> .BuildSuccessResult("Success Add Category")); } catch (Exception ex) { return(OperationResult <string> .BuildFailure(ex.Message)); } }