public TntWOChg AddTnt(TntOnly newTnt) { var tntEntity = _autoMapper.Map <Data.Entities.Tnt>(newTnt); tntEntity.Chg.Add( new Data.Entities.Chg() { ChgDate = _dateTime.UtcNow, ChgState = _chgStateQueryProcessor.Get(7), // Tenant -> Create ChgBy = _usrQueryProcessor.Get(1) // Default user } ); tntEntity.Cfg = _cfgQueryProcessor.Get(newTnt.Cfg); _queryProcessor.AddTnt(tntEntity); var tnt = _autoMapper.Map <TntWOChg>(tntEntity); // TODO: Implement link service tnt.AddLink(new Link { Method = HttpMethod.Get.Method, Href = Mss.Common.Constants.DefaultLegacyNamespace + Mss.Common.Constants.CommonRoutingDefinitions.ApiSegmentName + '/' + Mss.Common.Constants.CommonRoutingDefinitions.CurrentApiVersion + '/' + Mss.Common.Constants.CommonControllerDefinitions.Tnt + '/' + tnt.Id, Rel = Constants.CommonLinkRelValues.Self }); return(tnt); }
public IHttpActionResult AddTenant(HttpRequestMessage requestMessage, TntOnly newTnt) { var tnt = _addTntMaintenanceProcessor.AddTnt(newTnt); var result = new TntCreatedActionResult(requestMessage, tnt); return(result); }