コード例 #1
0
        public byte[] GetFileUpload(out FileUploadResponseViewModel response, string id)
        {
            response = new FileUploadResponseViewModel();

            var file = _db.FileUpload.Where(s => s.Id == id).FirstOrDefault();


            response.FullName = file.FileName;
            response.Url      = AppConfigUtilities.GetDomain() + "/api/authentication/GetFile?Id=" + id;


            response.Id = file.Id;

            return(file.File);
        }
コード例 #2
0
 public void Info(string message, string module = "", string CreateBy = "")
 {
     try
     {
         using (var scope = new TransactionScope(TransactionScopeOption.Suppress))
         {
             var log = new LogMessage();
             log.Message    = message;
             log.Level      = EnumLogLevel.Info.ToString();
             log.Module     = module;
             log.CreateBy   = CreateBy;
             log.CreateDate = DateTime.Now;
             log.Domain     = AppConfigUtilities.GetDomain();
             _db.LogMessages.Add(log);
             _db.SaveChanges();
             scope.Complete();
         }
     }
     catch (Exception e)
     {
         WriteLogLocal(message, "", module);
     }
 }