- Microsoft.EntityFrameworkCore
- Microsoft.EntityFrameworkCore.SqlServer - Only if MS SQL Server is used
- Microsoft.EntityFrameworkCore.Design
- Microsoft.EntityFrameworkCore.Tools
- Create models
| #!markdown | |
| # Using SQLite in Notebook | |
| Install ExtensionLab NuGet package | |
| #!csharp | |
| #r "nuget: System.Data.SQLite, *-*" | |
| #r "nuget: Microsoft.DotNet.Interactive.ExtensionLab, *-*" |
| #!markdown | |
| Records in C# | |
| #!csharp | |
| public class Course | |
| { | |
| public string Name {get; set;} | |
| public string Author {get; set;} |
| using System.Collections.Generic; | |
| using System.Linq.Expressions; | |
| namespace System.Linq | |
| { | |
| public static class QueryableHelper | |
| { | |
| public static IQueryable<TEntity> Search<TEntity>(this IQueryable<TEntity> query, string searchValue, params Expression<Func<TEntity, string>>[] propertiesToSearch) | |
| { | |
| if (string.IsNullOrEmpty(searchValue)) return query; |
| using System; | |
| using System.Collections.Generic; | |
| using System.Diagnostics; | |
| using System.IO; | |
| using System.Linq; | |
| using System.Text.RegularExpressions; | |
| /// <summary> | |
| /// Provides methods for checking method arguments for validity and throwing localizable exceptions for invalid | |
| /// arguments or argument combinations. |
| using System; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Collections.Generic; | |
| using System.Globalization; | |
| public static partial class StringExtensions | |
| { | |
| public static sbyte ToSByte(this string s) | |
| { |
| | |
| using System; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Globalization; | |
| namespace TextDataUtility | |
| { | |
| public static partial class StringExtensions | |
| { |
| /* | |
| ORM (Object-Relational Mapping) allows us to have a framework | |
| for storing objects within relational databases and translating between | |
| DATABASE-CODE communication. | |
| What is ORM? | |
| 1. Object relational mapping is a technique for storing, | |
| retrieving, updating and deleting (CRUD) from | |
| an object-oriented program in a relational database. | |
| 2. Utilization of "data layer" to manage translation between the OO and relational |
| using System; | |
| using System.Threading; | |
| namespace MT.Tests | |
| { | |
| /// <summary> | |
| /// An object containing some information. | |
| /// </summary> | |
| public class Logic | |
| { |