Bonjour ,
Je suis tout nouveau dans le MVC et je voulais creer un modele contact suivant un site
mais le probleme c'est que le site est en c# et je code en VB (debutant aussi) et les transformateur de code ne marche pas sur cette parti du code
en cherchant un peu sur internet j'ai trouvé un truc mais lorsque je veux l integrer dans un controleur il me met une erreur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 using System.ComponentModel.DataAnnotations; using System.Globalization; namespace ContactManager.Models { public class Contact { public int ContactId { get; set; } public string Name { get; set; } public string Address { get; set; } public string City { get; set; } public string State { get; set; } public string Zip { get; set; } [DataType(DataType.EmailAddress)] public string Email { get; set; } } }
voila mon code
voici l'erreur dite
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76 Namespace ContactManager.Models Public Class Contacts Private _ContactId As Integer Public Overridable Property ContactId() As Integer Get Return _ContactId End Get Protected Set(ByVal value As Integer) _ContactId = value End Set End Property Private _Name As String Public Overridable Property Name() As String Get Return _Name End Get Protected Set(ByVal value As String) _Name = value End Set End Property Private _Address As String Public Overridable Property Address() As String Get Return _Address End Get Protected Set(ByVal value As String) _Address = value End Set End Property Private _City As String Public Overridable Property City() As String Get Return _City End Get Protected Set(ByVal value As String) _City = value End Set End Property Private _State As String Public Overridable Property State() As String Get Return _State End Get Protected Set(ByVal value As String) _State = value End Set End Property Private _Zip As String Public Overridable Property Zip() As String Get Return _Zip End Get Protected Set(ByVal value As String) _Zip = value End Set End Property Private _Email As String Public Overridable Property Email() As String Get Return _Email End Get Protected Set(ByVal value As String) _Email = value End Set End Property End Class ' [DataType(DataType.EmailAddress)] End Namespace
Merci d'avance
Partager