Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
                }
            }
        }
Beispiel #3
0
        public bool add(Modelo prEntity)
        {
            try
            {
                Servico Entity = (Servico)prEntity;

                Servicos.Add(Entity);

                return(SaveChanges() > 0);
            }
            catch (Exception e)
            {
                return(false);
            }
        }