Esempio n. 1
0
 public AuditService()
 {
     _allProperties = new Lazy <IDictionary <Guid, IAuditProperty> >(() =>
                                                                     EventKinds.SelectMany(k => k.Properties).Distinct().ToDictionary(p => p.ID));
     _allEventKinds = new Lazy <IDictionary <Guid, AuditEventKind> >(() =>
                                                                     EventKinds.ToDictionary(k => k.ID));
     _filterFactories = new Lazy <ILookup <string, IAuditEventFilterFactory <TDomain> > >(() =>
                                                                                          FilterFactories.EmptyIfNull().ToLookup(f => f.Id.ToString(), StringComparer.InvariantCultureIgnoreCase));
 }
Esempio n. 2
0
        public ActionResult GetSelector(string propertyId, string onChangeFunction)
        {
            var sel = from id in Maybe.ParseGuid(propertyId)
                      from prop in EventKinds.SelectMany(k => k.Properties).FirstOrDefault(p => p.ID == id)
                      from ui in RenderSelector(Composition, prop, null)
                      select ui;

            if (sel.Kind == MaybeKind.Null)
            {
                return(HttpNotFound());
            }

            return(View <Views.PropertyValueSelector>().WithModel(new Models.ValueSelectorModel
            {
                Selector = sel.Value, OnChangeFunction = onChangeFunction
            }));
        }