|
|
Ligne 1 : |
Ligne 1 : |
| = razor =
| |
| <kode lang='razor'>
| |
| @page "/mypage"
| |
| @inherits MyPageBase
| |
| <h1>Title</h1>
| |
| </kode>
| |
|
| |
| <kode lang='blazor'>
| |
| @page "/mypage"
| |
| @inherits MyPageBase
| |
| <h1>Title</h1>
| |
| </kode>
| |
|
| |
| <kode lang='cshtml'>
| |
| @page "/mypage"
| |
| @inherits MyPageBase
| |
| <h1>Title</h1>
| |
| </kode>
| |
|
| |
| = tsql =
| |
| <kode lang='tsql'>
| |
| IF NOT EXISTS (SELECT *
| |
| FROM INFORMATION_SCHEMA.TABLES
| |
| WHERE TABLE_SCHEMA = 'MonSchema'
| |
| AND TABLE_NAME = 'MaTable')
| |
| BEGIN
| |
| create table MonSchema.MaTable (
| |
| -- clé primaire
| |
| id int identity(1, 1) constraint pk_maTable primary key,
| |
| -- insère le nom de l’utilisateur courant par defaut
| |
| [colonne_2] varchar(50) NOT NULL DEFAULT SYSTEM_USER,
| |
| -- insère la date courant si rien n’est spécifié
| |
| [colonne_3] datetime NOT NULL DEFAULT GETDATE()
| |
| );
| |
| END
| |
|
| |
| -- Supprimer une table
| |
| drop table MonSchema.MaTable;
| |
|
| |
| -- Supprimer toutes les tables
| |
| EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT all'
| |
| EXEC sp_MSForEachTable 'DROP TABLE ?'
| |
| </kode>
| |
|
| |
| = no highlight = | | = no highlight = |
| <kode lang='cs'> | | <kode lang='cs'> |
Ligne 54 : |
Ligne 10 : |
| <kode lang='nohighlight'> | | <kode lang='nohighlight'> |
| var myObject = new MyCLass(); | | var myObject = new MyCLass(); |
| </kode>
| |
|
| |
| = highlight C# =
| |
| <kode lang='cs'>
| |
| using System.IO.Compression;
| |
|
| |
| namespace MyApplication
| |
| {
| |
| interface IInterface { }
| |
|
| |
| class Program : IInterface
| |
| {
| |
| /// <summary>
| |
| /// Main method
| |
| /// </summary>
| |
| /// <param name="args"></param>
| |
| static void Main(string[] args)
| |
| {
| |
| // comment
| |
| /* multi-lines
| |
| * comment
| |
| */
| |
| Console.WriteLine($"Hello {Name}!");
| |
|
| |
| if (b == true)
| |
| {
| |
| // FIXME
| |
| MyClass mc;
| |
| MyClass mc = new MyClass(myVariable, MyProperty, myVariable.MyProperty);
| |
| IMyInterface mi = MyClass<IMyInterface>.Create(new MyClass("test"));
| |
| MyClass.MyStaticMethod(myVariable, MyProperty, myVariable.MyProperty);
| |
| List<int> li = new List<int>() { 1, 2, 3 };
| |
| MyClass[] amc = new MyClass[] { 1, 2, 3 };
| |
|
| |
| MyClass mc = mc;
| |
| Myclass mc = mc;
| |
|
| |
| Type t = typeof(MyClass);
| |
| Type t = typeof(IInterface);
| |
| Type t = typeof(MyClass<int>);
| |
| Type t = typeof(IInterface<int>);
| |
| Type t = typeof(MyClass<IInterface>);
| |
|
| |
| DateTime d = new DateTime();
| |
| DateTime? d = null;
| |
|
| |
| var engine = new FileHelperAsyncEngine<DailyValue>();
| |
|
| |
| Contract.Requires<ArgumentNullException>(argument != null);
| |
|
| |
| var un_objet = Session["clé"] as MaClasse;
| |
|
| |
| catch (Exception ex)
| |
| {
| |
| lbStatus.Text = "Error: " + ex.Message;
| |
| }
| |
| }
| |
| else if (b == false)
| |
| {
| |
| var query = from p in entities.Persons
| |
| select new { First = p.FirstName, Last = p.LastName };
| |
| }
| |
| else
| |
| {
| |
| MyProperty = "value";
| |
| MyMethod(myVariable, MyProperty, myVariable.MyProperty);
| |
| }
| |
|
| |
| foreach (MyClass<int> mc in mcList)
| |
| {
| |
| }
| |
|
| |
| foreach (MyClass mc in mcList)
| |
| {
| |
| }
| |
|
| |
| using (GZipStream s = new GZipStream(fs, CompressionMode.Decompress))
| |
| {
| |
| }
| |
| }
| |
|
| |
| [DataMember("")]
| |
| private List<int> MyMethod(MaClasse mc, MaClasse<int> mci, IInterface ii, MaClasse<MaClasse> mcmc)
| |
| {
| |
| }
| |
|
| |
| public void Methode(DateTime date1 = default(DateTime), DateTime? date2 = null)
| |
| {
| |
| if (date1 == default(DateTime)) date1 = new DateTime(...);
| |
| if (date2 == null) date2 = new DateTime(...);
| |
| }
| |
| }
| |
| }
| |
| </kode> | | </kode> |
|
| |
|