Esempio n. 1
0
        /// <summary>
        /// Returns the Content block instance that is textually represented with a specified string value, or null if no such object is found.<para/>
        /// </summary>
        /// <param name="text">The text representing the Content block to be retrieved from the database.</param>
        /// <returns>The Content block object whose string representation matches the specified text.</returns>
        public static ContentBlock Parse(string text)
        {
            if (text.IsEmpty())
            {
                throw new ArgumentNullException(nameof(text));
            }

            return(Database.Find <ContentBlock>(c => c.Key == text));
        }
Esempio n. 2
0
        /* -------------------------- Methods ----------------------------*/

        public static Settings Parse(string text)
        {
            if (text.LacksValue())
            {
                throw new ArgumentNullException(nameof(text));
            }

            return(Database.Find <Settings>(s => s.Name == text));
        }
Esempio n. 3
0
 /* -------------------------- Methods ----------------------------*/
 /// <summary>
 /// Find and returns an instance of Content block from the database by its Key.<para/>
 ///                               If no matching Content block is found, it returns Null.<para/>
 /// </summary>
 /// <param name="key">The Key of the requested Content block.</param>
 /// <returns>
 /// The Content block instance with the specified Key or null if there is no Content block with that Key in the database.<para/>
 /// </returns>
 public static ContentBlock FindByKey(string key)
 {
     return(Database.Find <ContentBlock>(c => c.Key == key));
 }
Esempio n. 4
0
 /* -------------------------- Methods ----------------------------*/
 /// <summary>
 /// Find and returns an instance of User from the database by its Email.<para/>
 ///                               If no matching User is found, it returns Null.<para/>
 /// </summary>
 /// <param name="email">The Email of the requested User.</param>
 /// <returns>
 /// The User instance with the specified Email or null if there is no User with that Email in the database.<para/>
 /// </returns>
 public static User FindByEmail(string email)
 {
     return(Database.Find <User>(u => u.Email == email));
 }
Esempio n. 5
0
        /* -------------------------- Methods ----------------------------*/

        public static ContactType FindByName(string name)
        {
            return(Database.Find <ContactType>(c => c.Name == name));
        }