Beispiel #1
0
        internal static void SaveMultiTenant(AppAccountInfo info)
        {
            var metaObject = _MetaObjectProvider.GetObjectMeta(MultiTenantMetaObjectName, info.TenantId);
            var objectData = new ObjectData(metaObject);

            objectData.ID           = new Guid(info.AppAccountId);
            objectData.TenantID     = info.TenantId;
            objectData["Name"]      = info.Name;
            objectData["Type"]      = info.Type;
            objectData["SourceId"]  = info.SourceId;
            objectData["AppId"]     = info.AppId;
            objectData["AppSecret"] = info.AppSecret;
            objectData["State"]     = (int)info.State;
            objectData["AgentId"]   = info.AgentId;
            objectData["Tag"]       = info.Tag;
            objectData.ModifiedBy   = info.ModifyBy;
            objectData.ModifiedTime = DateTime.Now;

            var isExist = _DataAccessProvider.IsExists(MultiTenantMetaObjectName, info.TenantId, info.AppAccountId);

            if (isExist)
            {
                _DataAccessProvider.Update(objectData);
            }
            else
            {
                objectData.CreatedBy   = info.CreateBy;
                objectData.CreatedTime = DateTime.Now;
                _DataAccessProvider.Add(objectData);
            }
        }
Beispiel #2
0
 public async Task CreateAsync([FromBody] Employee employee)
 {
     if (ModelState.IsValid)
     {
         await _dataAccessProvider.Add(employee);
     }
 }