private static void AddService(Tuple <Type, Type> service) { if (Servicos.ContainsKey(service.Item1)) { throw new DesenvolvimentoIncorretoException($"There are two service classes with the same Nome {service.Item1} - {service.Item2}. This is not allowed."); } Servicos.Add(service.Item1, service.Item2); }
private async void AsyncServicos(string _origem) { var t = Task.Factory.StartNew(() => new mData().Servicos(_origem)); await t; if (t.IsCompleted) { foreach (mTiposGenericos s in t.Result) { Servicos.Add(s.Nome); } } }
public bool add(Modelo prEntity) { try { Servico Entity = (Servico)prEntity; Servicos.Add(Entity); return(SaveChanges() > 0); } catch (Exception e) { return(false); } }