Esempio n. 1
0
        private static void HigLaboMapperTest()
        {
            var data   = SiteSummaryData.Create();
            var config = ObjectMapConfig.Current;

            config.AddPostAction <Int32, String>((source, target) =>
            {
                target = source.ToString("0.000");
                return(target);
            });

            var c1 = new ScheduleSource();

            c1.Value        = 123;
            c1.ScheduleType = ScheduleType.Hidden;
            var p1 = new People()
            {
                Name = "Marco"
            };

            p1.Schedule              = new Schedule();
            p1.Schedule.Value        = 123;
            p1.Schedule.ScheduleType = ScheduleType.Private;
            p1.Schedule.Peoples      = new List <People>();
            p1.Schedule.Peoples.Add(p1);
            c1.Peoples.Add(p1);

            c1.Tags.Add("C#");
            c1.Tags.Add("ASP.NET");

            var d = new Dictionary <String, String>();

            d["Value"] = "as";
            var c2 = config.Map(c1, new Schedule());
        }
Esempio n. 2
0
        public static SiteSummaryData Create()
        {
            var data = new SiteSummaryData();

            data.Data       = new CollectionWithPropety();
            data.Data.Name  = "Tag Data 2016/11";
            data.Data.Year  = 2016;
            data.Data.Month = 11;
            data.Data.Tags  = new[] { "C#", "Ruby", "AWS" };
            data.Data.TagList.AddRange(new[] { "C#", "Ruby", "AWS" });

            for (int i = 0; i < 20; i++)
            {
                data.Data.AccessData.Add(new CollectionWithPropety.AccessInfo()
                {
                    Date        = DateTime.Now.AddDays(-20 + i),
                    AccessCount = i * 100
                });
            }

            return(data);
        }