コード例 #1
0
        public static void RegisterNoteType(NoteTypeEntity noteType)
        {
            if (!noteType.Key.HasText())
            {
                throw new InvalidOperationException("noteType must have a key, use MakeSymbol method after the constructor when declaring it");
            }

            SystemNoteTypes.Add(noteType);
        }
コード例 #2
0
        public static NoteEntity?CreateNote <T>(this Lite <T> entity, string text, NoteTypeEntity noteType, Lite <UserEntity>?user = null, string?title = null) where T : class, IEntity
        {
            if (started == false)
            {
                return(null);
            }

            return(new NoteEntity
            {
                CreatedBy = user ?? UserEntity.Current.ToLite(),
                Text = text,
                Title = title,
                Target = (Lite <Entity>)Lite.Create(entity.EntityType, entity.Id, entity.ToString()),
                NoteType = noteType
            }.Execute(NoteOperation.Save));
        }