public DocsMarshal.Entities.ProfileForInsert ToProfileForInsert(bool raiseWorkflowEvents) { var ritorno = new DocsMarshal.Entities.ProfileForInsert(); ritorno.ClassTypeExternalID = ClassTypeExternalId; AddStdFieldToIProfileFor(ritorno, raiseWorkflowEvents); return(ritorno); }
public async Task <ProfileInserted> InsertAsync(DocsMarshal.Entities.ProfileForInsert profileForInsert) { try { // controllo che il profilo non sia null if (profileForInsert == null) { throw new ArgumentNullException("profile is null"); } var rit = await Orchestrator.PostAsync("/DMProfile/Insert", new { sessionID = Orchestrator.SessionId, ProfileForInsert = profileForInsert }, new { Result = new Entities.ProfileInserted() }); return(rit.Result); } catch (Exception ex) { return(new ProfileInserted { Error = ex.Message, HasError = true }); } }
/* public async Task<ProfileForInsert> GetNewInstanceForInsertByClassTypeExternalId(string classTypeExternalId) * { * return await GetNewInstanceForInsertByClassTypeExternalIdAsync(classTypeExternalId); * } * * public async Task<ProfileForInsert> GetNewInstanceForInsertByClassTypeExternalIdAsync(string classTypeExternalId) * { * if (string.IsNullOrWhiteSpace(classTypeExternalId)) throw new ArgumentNullException("classTypeExternalId"); * using (var client = new HttpClient()) * { * string url = string.Format("{0}/{1}", Orchestrator.DocsMarshalUrl, "/DMProfile/GetProfileForInsertByClasstypeExternalId"); * UriBuilder builder = new UriBuilder(url); * builder.Query = string.Format("sessionId={0}&classtypeExternalId={1}",Orchestrator.SessionId, classTypeExternalId); * var response = await client.GetAsync(builder.Uri); * string rit = await response.Content.ReadAsStringAsync(); * var ritO = JsonConvert.DeserializeObject<root>(rit); * return ritO.result; * } * }*/ public async Task <ProfileInserted> Insert(DocsMarshal.Entities.ProfileForInsert profile) { return(await InsertAsync(profile)); }