Exemple #1
0
        public override Task <Empty> DeleteCompanyDescription(CompDescArray request, ServerCallContext context)
        {
            var pocos = ProtoToPoco(request);

            _logic.Delete(pocos.ToArray());
            return(new Task <Empty>(() => new Empty()));
        }
Exemple #2
0
        public List <CompanyDescriptionPoco> ProtoToPoco(CompDescArray request)
        {
            List <CompanyDescriptionPoco> pocos = new List <CompanyDescriptionPoco>();
            var inputList = request.CompDesc.ToList();

            foreach (var item in inputList)
            {
                var poco = new CompanyDescriptionPoco();
                poco.Id                 = Guid.Parse(item.Id);
                poco.Company            = Guid.Parse(item.Company);
                poco.LanguageId         = item.LanguageId;
                poco.CompanyName        = item.CompanyName;
                poco.CompanyDescription = item.CompanyDescription;
                pocos.Add(poco);
            }
            return(pocos);
        }
Exemple #3
0
        public override Task <CompDescArray> GetAllCompanyDescription(Empty request, ServerCallContext context)
        {
            List <CompanyDescriptionPoco> pocos        = _logic.GetAll();
            List <CompDescProto>          compDescList = new List <CompDescProto>();

            foreach (var poco in pocos)
            {
                CompDescProto compDesc = new CompDescProto();
                compDesc.Id                 = poco.Id.ToString();
                compDesc.Company            = poco.Company.ToString();
                compDesc.LanguageId         = poco.LanguageId;
                compDesc.CompanyName        = poco.CompanyName;
                compDesc.CompanyDescription = poco.CompanyDescription;
                compDescList.Add(compDesc);
            }
            CompDescArray compDescArray = new CompDescArray();

            compDescArray.CompDesc.AddRange(compDescList);
            return(new Task <CompDescArray>(() => compDescArray));
        }