Пример #1
0
        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));
            }
        }
Пример #2
0
        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));
            }
        }
Пример #3
0
        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));
            }
        }