Beispiel #1
0
        public LogSourceInput(LogSourceModel value, ICollection<LogSourceModel> sources)
        {
            Debug.Assert (sources != null, "LogSourceInput.ctor: levels is null.");

            Value = value;
            Sources = sources;
        }
        public LogSourceInput(LogSourceModel value, ICollection <LogSourceModel> sources)
        {
            Debug.Assert(sources != null, "LogSourceInput.ctor: levels is null.");

            Value   = value;
            Sources = sources;
        }
Beispiel #3
0
        // GET: Log
        public ActionResult List(LogQuery formModel)
        {
            var eventsCollection = repository_.GetEvents (formModel);

            var sourceId = eventsCollection.Source;
            var sourceSize = eventsCollection.SourceSize;
            var source = new LogSourceModel (sourceId, sourceSize);

            var sources = repository_
                .GetSources ()
                .Select (id => new LogSourceModel (id, id == sourceId ? (long?) sourceSize : null))
                .ToList ();

            formModel.Source = new LogSourceInput (source, sources);

            var viewModel = new LogIndexViewModel
            {
                Query = formModel,
                Events = eventsCollection.Events
            };

            return View (viewModel);
        }