public bool UpdateOpportunity(Guid id, ProxyOpportunity opp) { //var xrm = new XrmServiceContext("Xrm"); Xrm.Opportunity orig = this.xrm.OpportunitySet.Where(c => c.Id == id).FirstOrDefault(); orig.Description = opp.Description; xrm.Update(orig); return(true); }
public List <ProxyOpportunity> GetAllOpportunity() { List <ProxyOpportunity> accs = new List <ProxyOpportunity>(); //using (var xrm = new XrmServiceContext("Xrm")) //{ var all = xrm.OpportunitySet; foreach (Opportunity item in all) { ProxyOpportunity converted = ObjectConverter.ConvertToReadableOpportunity(item, this.xrm); accs.Add(converted); } //} return(accs); }