New SQL Server project templates for VS2015 (CSSqlUserDefinedType.cs)
1: using System;
2: using System.Data;
3: using System.Data.SqlClient;
4: using System.Data.SqlTypes;
5: using Microsoft.SqlServer.Server;
6:
7:
8: [Serializable]
9: [Microsoft.SqlServer.Server.SqlUserDefinedType(Format.Native)]
10: public struct $safeitemname$: INullable
11: {
12: public override string ToString()
13: {
14: // $ReplaceCodeComment$
15: return string.Empty;
16: }
17:
18: public bool IsNull
19: {
20: get
21: {
22: // $PutYourCodeHereComment$
23: return _null;
24: }
25: }
26:
27: public static $safeitemname$ Null
28: {
29: get
30: {
31: $safeitemname$ h = new $safeitemname$();
32: h._null = true;
33: return h;
34: }
35: }
36:
37: public static $safeitemname$ Parse(SqlString s)
38: {
39: if (s.IsNull)
40: return Null;
41: $safeitemname$ u = new $safeitemname$();
42: // $PutYourCodeHereComment$
43: return u;
44: }
45:
46: // $PlaceholderMethodComment$
47: public string Method1()
48: {
49: // $PutYourCodeHereComment$
50: return string.Empty;
51: }
52:
53: // $PlaceholderStaticMethodComment$
54: public static SqlString Method2()
55: {
56: // $PutYourCodeHereComment$
57: return new SqlString("");
58: }
59:
60: // $PlaceholderFieldComment$
61: public int _var1;
62:
63: // $PrivateMemberComment$
64: private bool _null;
65: }
Comments (
)
|