示例#1
0
        private Kanonas GetFromRepository()
        {
            if (_katavasia == null)
            {
                GetKatavasiaResponse response = katavasiaContext.Get(
                    new GetKatavasiaRequest()
                {
                    Name = Name
                });

                if (response.Exception == null && response.BookElement != null)
                {
                    _katavasia = response.BookElement;
                }
            }

            return(_katavasia);
        }
示例#2
0
        public GetKatavasiaResponse Get(GetKatavasiaRequest request)
        {
            GetKatavasiaResponse response = new GetKatavasiaResponse();

            try
            {
                Katavasia katavasia = _unitOfWork.Repository <Katavasia>()
                                      .Get(c => c.Name == request.Name);

                response.BookElement = katavasia.GetElement();
            }
            catch (Exception ex)
            {
                response.Exception = ex;
            }

            return(response);
        }