Exemplo n.º 1
0
        public void GetMetadDataTest()
        {
            ICollection <TakeDocModel.MetaData> metas = servMeta.GetByVersion(MyDocument.DocumentCurrentVersionId.Value, MyDocument.EntityId);

            Assert.IsTrue(metas.Count() > 0);
            TakeDocModel.MetaData mois = metas.Where(x => x.MetaDataName == "MONTH").First();
            Assert.IsTrue(mois.DataFieldValues.ToList().Count() == 12);
        }
Exemplo n.º 2
0
        public HttpResponseMessage GetMetaData(Guid versionId, Guid entityId)
        {
            IMetaDataService servMetaData = Utility.MyUnityHelper.UnityHelper.Resolve <IMetaDataService>();

            try
            {
                ICollection <TakeDocModel.MetaData> metadatas = servMetaData.GetByVersion(versionId, entityId);
                ICollection <object> json = servMetaData.GetJson(metadatas);
                return(Request.CreateResponse(json));
            }
            catch (Exception ex)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.InternalServerError, ex.Message));
            }
        }