Esempio n. 1
0
        public static IResultEngine Success(string message)
        {
            ResultEngine result = new ResultEngine();

            result.Succeeded = true;
            result.Message   = message;
            return(result);
        }
Esempio n. 2
0
        public static IResultEngine Fail(string message)
        {
            ResultEngine result = new ResultEngine();

            result.Failed  = false;
            result.Message = message;
            return(result);
        }
Esempio n. 3
0
        public static IResultEngine Success()
        {
            ResultEngine result = new ResultEngine();

            result.Succeeded = true;
            result.Message   = "";
            return(result);
        }
Esempio n. 4
0
        public static IResultEngine Fail()
        {
            ResultEngine result = new ResultEngine();

            result.Failed  = false;
            result.Message = "";
            return(result);
        }
Esempio n. 5
0
        public async Task <IResultEngine> UpdateAsync(ArticleModelEngine article)
        {
            try
            {
                Logger.Information($"Method:{MethodBase.GetCurrentMethod().DeclaringType.FullName} Parametrs:article={article?.Name}");
                var dbArtikle = Mapper.Map <Articles>(article);
                var res       = await ArtikleDA.UpdateAsync(dbArtikle);

                var result = Mapper.Map <IResultEngine>(res);
                return(await Task.FromResult(result));
            }
            catch (Exception ex)
            {
                Logger.Error($"Error:{ex.ToString()}");
                return(await Task.FromResult(ResultEngine.Fail()));
            }
        }