Kobus 5 anos atrás
pai
commit
6b2b21e6f7

+ 0
- 11
UnivateProperties_API/Containers/Property/PropertyDisplay.cs Ver arquivo

29
         public string DisplayImage { get; set; }
29
         public string DisplayImage { get; set; }
30
         #endregion 
30
         #endregion 
31
     }
31
     }
32
-
33
-    public class PropertySearch
34
-    {
35
-        #region Properties
36
-        public string Type { get; set; }
37
-        public string PropertyType { get; set; }
38
-        public string Province { get; set; }
39
-        public string City { get; set; }
40
-        public string Suburb { get; set; }
41
-        #endregion
42
-    }
43
 }
32
 }

+ 34
- 2
UnivateProperties_API/Controllers/Properties/PropertyController.cs Ver arquivo

1
 using Microsoft.AspNetCore.Mvc;
1
 using Microsoft.AspNetCore.Mvc;
2
-using System;
2
+using System.Collections.Generic;
3
+using System.Linq;
3
 using System.Transactions;
4
 using System.Transactions;
4
-using UnivateProperties_API.Containers.Property;
5
 using UnivateProperties_API.Model.Property;
5
 using UnivateProperties_API.Model.Property;
6
 using UnivateProperties_API.Repository.Properties;
6
 using UnivateProperties_API.Repository.Properties;
7
 
7
 
42
             return new OkObjectResult(_Repo.GetDisplay(type, propertyType, province, city, suburb, propType));
42
             return new OkObjectResult(_Repo.GetDisplay(type, propertyType, province, city, suburb, propType));
43
         }
43
         }
44
 
44
 
45
+        [HttpGet("{type}/{by}")]
46
+        public IActionResult SearchBy(string type, string by)
47
+        {
48
+            PropertyUsageType pType = PropertyUsageType.Both;
49
+            switch (type.ToUpper())
50
+            {
51
+                case "RESIDENTIAL":
52
+                    pType = PropertyUsageType.Residential;
53
+                    break;
54
+                case "COMMERCIAL":
55
+                    pType = PropertyUsageType.Commercial;
56
+                    break;
57
+            }
58
+
59
+            if (pType != PropertyUsageType.Both)
60
+            {
61
+                List<int> proptypeIds = (from pt in _Repo.GetPropertyTypes(p => p.UsageType == pType)
62
+                                         select pt.Id).ToList();
63
+
64
+                if (string.IsNullOrEmpty(by) || by.ToUpper() == "ALL")
65
+                {
66
+                    return new OkObjectResult(_Repo.Get(x => proptypeIds.Contains(x.PropertyTypeId)));
67
+                }
68
+                else
69
+                {
70
+                    return new OkObjectResult(_Repo.Get(x => proptypeIds.Contains(x.PropertyTypeId) && x.CreatedBy == by));
71
+                }
72
+            }
73
+            else
74
+                return new NoContentResult();
75
+        }
76
+
45
         [HttpPost]
77
         [HttpPost]
46
         public IActionResult Post([FromBody] Property property)
78
         public IActionResult Post([FromBody] Property property)
47
         {
79
         {

+ 4
- 11
UnivateProperties_API/Controllers/Users/IndividualController.cs Ver arquivo

17
             _Repo = repo;
17
             _Repo = repo;
18
         }
18
         }
19
 
19
 
20
+        //Gets data from the DB
20
         [HttpGet]
21
         [HttpGet]
21
         public IActionResult Get()
22
         public IActionResult Get()
22
         {
23
         {
23
             return new OkObjectResult(_Repo.GetAll());
24
             return new OkObjectResult(_Repo.GetAll());
24
         }
25
         }
25
 
26
 
27
+        //Gets data from DB by Id
26
         [HttpGet("{id}")]
28
         [HttpGet("{id}")]
27
         public IActionResult Get(int id)
29
         public IActionResult Get(int id)
28
         {
30
         {
29
             return new OkObjectResult(_Repo.Get(x => x.Id == id));
31
             return new OkObjectResult(_Repo.Get(x => x.Id == id));
30
         }
32
         }
31
 
33
 
32
-        [HttpPost()]
33
-        public IActionResult Post([FromBody] Individual individual)
34
-        {
35
-            using (var scope = new TransactionScope())
36
-            {
37
-                _Repo.Insert(individual);
38
-                scope.Complete();
39
-                return CreatedAtAction(nameof(Get), new { id = individual.Id }, individual);
40
-            }
41
-        }
42
-
34
+        //Updates to DB
43
         [HttpPut()]
35
         [HttpPut()]
44
         public IActionResult Put([FromBody] Individual individual)
36
         public IActionResult Put([FromBody] Individual individual)
45
         {
37
         {
55
             return new NoContentResult();
47
             return new NoContentResult();
56
         }
48
         }
57
 
49
 
50
+        //Updates DB by removing said Id
58
         [HttpDelete("{id}")]
51
         [HttpDelete("{id}")]
59
         public IActionResult Delete(int id)
52
         public IActionResult Delete(int id)
60
         {
53
         {

+ 63
- 103
UnivateProperties_API/Controllers/Users/RegisterController.cs Ver arquivo

33
             _appSettings = appSettings.Value;
33
             _appSettings = appSettings.Value;
34
         }
34
         }
35
 
35
 
36
+        //Works
36
         [AllowAnonymous]
37
         [AllowAnonymous]
37
         [HttpPost("authenticate")]
38
         [HttpPost("authenticate")]
38
         public IActionResult Authenticate([FromBody]UserDto userDto)
39
         public IActionResult Authenticate([FromBody]UserDto userDto)
68
             });
69
             });
69
         }
70
         }
70
 
71
 
72
+        //Writes to DB
71
         [AllowAnonymous]
73
         [AllowAnonymous]
72
         [HttpPost("register")]
74
         [HttpPost("register")]
73
-        public IActionResult Register([FromBody]UserDto userDto)
75
+        public IActionResult Register([FromBody]UserDto individual)
74
         {
76
         {
75
-            // map dto to entity
76
-            var user = _mapper.Map<User>(userDto);
77
+            _mapper.Map<Individual>(individual);
77
 
78
 
78
             try
79
             try
79
             {
80
             {
80
-                // save 
81
-                _Repo.Create(user, userDto.Password, true);
81
+                _Repo.CreatePerson(individual, PersonType.Individual, true, null);
82
                 return Ok();
82
                 return Ok();
83
             }
83
             }
84
             catch (AppException ex)
84
             catch (AppException ex)
85
             {
85
             {
86
-                // return error message if there was an exception
87
-                return BadRequest(new { message = ex.Message });
86
+                return BadRequest(new { messge = ex.Message });
88
             }
87
             }
89
         }
88
         }
90
 
89
 
90
+        //Writes to DB
91
         [AllowAnonymous]
91
         [AllowAnonymous]
92
         [HttpPost("registeragency")]
92
         [HttpPost("registeragency")]
93
         public IActionResult RegisterAgency([FromBody]AgencyDto agency)
93
         public IActionResult RegisterAgency([FromBody]AgencyDto agency)
108
             }
108
             }
109
         }
109
         }
110
 
110
 
111
-        [HttpPut("{id}")]
112
-        public IActionResult Update(int id, [FromBody]UserDto userDto)
113
-        {
114
-            // map dto to entity and set id
115
-            var user = _mapper.Map<User>(userDto);
116
-            user.Id = id;
117
-
118
-            try
119
-            {
120
-                // save 
121
-                _Repo.Update(user, userDto.Password);
122
-                return Ok();
123
-            }
124
-            catch (AppException ex)
125
-            {
126
-                // return error message if there was an exception
127
-                return BadRequest(new { message = ex.Message });
128
-            }
129
-        }
130
-
131
-        [HttpPut("{id}")]
132
-        public IActionResult UpdateAgency(int id, [FromBody]UserDto userDto)
133
-        {
134
-            // map dto to entity and set id
135
-            var agency = _mapper.Map<Agency>(userDto);
136
-            agency.Id = id;
137
-
138
-            try
139
-            {
140
-                // save 
141
-                _Repo.UpdateAgency(agency, userDto.Password);
142
-                return Ok();
143
-            }
144
-            catch (AppException ex)
145
-            {
146
-                // return error message if there was an exception
147
-                return BadRequest(new { message = ex.Message });
148
-            }
149
-        }
150
-
151
-        [HttpGet("{id}")]
152
-        public IActionResult GetById(int id)
153
-        {
154
-            var user = _Repo.GetById(id);
155
-            var userDto = _mapper.Map<UserDto>(user);
156
-
157
-            if (user == null)
158
-            {
159
-                return NotFound();
160
-            }
161
-
162
-            // Only allow SuperAdmins to access other user records
163
-            var currentUserId = int.Parse(User.Identity.Name);
164
-            if (id != currentUserId && !User.IsInRole(Role.SuperAdmin))
165
-            {
166
-                return Forbid();
167
-            }
168
-
169
-            return Ok(userDto);
170
-        }
171
-
172
-        [HttpGet("{id}")]
173
-        public IActionResult GetByAgencyId(int id)
174
-        {
175
-            var agency = _Repo.GetByAgencyId(id);
176
-            var agencyDto = _mapper.Map<AgencyDto>(agency);
177
-
178
-            if (agency == null)
179
-            {
180
-                return NotFound();
181
-            }
182
-
183
-            var currentAgencyId = int.Parse(User.Identity.Name);
184
-            if (id != currentAgencyId && !User.IsInRole(Role.Agency))
185
-            {
186
-                return Forbid();
187
-            }
188
-
189
-            return Ok(agencyDto);
190
-        }
191
-
192
-        [Authorize(Roles = Role.SuperAdmin)]
193
-        [HttpDelete("{id}")]
194
-        public IActionResult Delete(User user)
195
-        {
196
-            _Repo.Delete(user.Id);
197
-            return Ok();
198
-        }
199
-
200
-        [Authorize(Roles = Role.SuperAdmin)]
201
-        [HttpDelete("{id}")]
202
-        public IActionResult DeleteAgency(Agency agency)
203
-        {
204
-            _Repo.DeleteAgency(agency.Id);
205
-            return Ok();
206
-        }
111
+        //[HttpGet("{id}")]
112
+        //public IActionResult GetById(int id)
113
+        //{
114
+        //    var user = _Repo.GetById(id);
115
+        //    var userDto = _mapper.Map<UserDto>(user);
116
+
117
+        //    if (user == null)
118
+        //    {
119
+        //        return NotFound();
120
+        //    }
121
+
122
+        //    // Only allow SuperAdmins to access other user records
123
+        //    var currentUserId = int.Parse(User.Identity.Name);
124
+        //    if (id != currentUserId && !User.IsInRole(Role.SuperAdmin))
125
+        //    {
126
+        //        return Forbid();
127
+        //    }
128
+
129
+        //    return Ok(userDto);
130
+        //}
131
+
132
+        //[HttpGet("{id}")]
133
+        //public IActionResult GetByAgencyId(int id)
134
+        //{
135
+        //    var agency = _Repo.GetByAgencyId(id);
136
+        //    var agencyDto = _mapper.Map<AgencyDto>(agency);
137
+
138
+        //    if (agency == null)
139
+        //    {
140
+        //        return NotFound();
141
+        //    }
142
+
143
+        //    var currentAgencyId = int.Parse(User.Identity.Name);
144
+        //    if (id != currentAgencyId && !User.IsInRole(Role.Agency))
145
+        //    {
146
+        //        return Forbid();
147
+        //    }
148
+
149
+        //    return Ok(agencyDto);
150
+        //}
151
+
152
+        //[Authorize(Roles = Role.SuperAdmin)]
153
+        //[HttpDelete("{id}")]
154
+        //public IActionResult Delete(User user)
155
+        //{
156
+        //    _Repo.Delete(user.Id);
157
+        //    return Ok();
158
+        //}
159
+
160
+        //[Authorize(Roles = Role.SuperAdmin)]
161
+        //[HttpDelete("{id}")]
162
+        //public IActionResult DeleteAgency(Agency agency)
163
+        //{
164
+        //    _Repo.DeleteAgency(agency.Id);
165
+        //    return Ok();
166
+        //}
207
     }
167
     }
208
 }
168
 }

+ 0
- 1
UnivateProperties_API/Controllers/Users/UserController.cs Ver arquivo

7
 
7
 
8
 namespace User_API.Controllers
8
 namespace User_API.Controllers
9
 {
9
 {
10
-    [Authorize]
11
     [Route("api/[controller]")]
10
     [Route("api/[controller]")]
12
     [ApiController]
11
     [ApiController]
13
     public class UserController : ControllerBase
12
     public class UserController : ControllerBase

+ 4
- 0
UnivateProperties_API/Helpers/AutoMapperProfile.cs Ver arquivo

12
             CreateMap<UserDto, User>();
12
             CreateMap<UserDto, User>();
13
             CreateMap<Agency, AgencyDto>();
13
             CreateMap<Agency, AgencyDto>();
14
             CreateMap<AgencyDto, Agency>();
14
             CreateMap<AgencyDto, Agency>();
15
+            CreateMap<Individual, UserDto>();
16
+            CreateMap<UserDto, Individual>();
17
+            CreateMap<Individual, Person>();
18
+            CreateMap<Person, Individual>();
15
         }
19
         }
16
     }
20
     }
17
 }
21
 }

+ 3
- 1
UnivateProperties_API/Model/Property/Property.cs Ver arquivo

8
     public class Property : BaseEntity
8
     public class Property : BaseEntity
9
     {
9
     {
10
         #region Properties
10
         #region Properties
11
-        [ForeignKey("PropertyType")]
11
+        public string CreatedBy { get; set; }
12
+        [ForeignKey("PropertyType")]        
12
         public int PropertyTypeId { get; set; }
13
         public int PropertyTypeId { get; set; }
13
         public string PropertyName { get; set; }
14
         public string PropertyName { get; set; }
14
         public string Unit { get; set; }
15
         public string Unit { get; set; }
24
         public int SuburbId { get; set; }
25
         public int SuburbId { get; set; }
25
         public int CityId { get; set; }
26
         public int CityId { get; set; }
26
         public int ProvinceId { get; set; }
27
         public int ProvinceId { get; set; }
28
+        public bool Published { get; set; }
27
 
29
 
28
         public virtual PropertyType PropertyType { get; set; }
30
         public virtual PropertyType PropertyType { get; set; }
29
         public virtual Province Province { get; set; }
31
         public virtual Province Province { get; set; }

+ 6
- 6
UnivateProperties_API/Properties/launchSettings.json Ver arquivo

1
-{
2
-  "$schema": "http://json.schemastore.org/launchsettings.json",
1
+{
3
   "iisSettings": {
2
   "iisSettings": {
4
-    "windowsAuthentication": false, 
5
-    "anonymousAuthentication": true, 
3
+    "windowsAuthentication": false,
4
+    "anonymousAuthentication": true,
6
     "iisExpress": {
5
     "iisExpress": {
7
       "applicationUrl": "http://localhost:57260",
6
       "applicationUrl": "http://localhost:57260",
8
       "sslPort": 0
7
       "sslPort": 0
9
     }
8
     }
10
   },
9
   },
10
+  "$schema": "http://json.schemastore.org/launchsettings.json",
11
   "profiles": {
11
   "profiles": {
12
     "IIS Express": {
12
     "IIS Express": {
13
       "commandName": "IISExpress",
13
       "commandName": "IISExpress",
21
       "commandName": "Project",
21
       "commandName": "Project",
22
       "launchBrowser": true,
22
       "launchBrowser": true,
23
       "launchUrl": "api/values",
23
       "launchUrl": "api/values",
24
-      "applicationUrl": "http://localhost:5000",
25
       "environmentVariables": {
24
       "environmentVariables": {
26
         "ASPNETCORE_ENVIRONMENT": "Development"
25
         "ASPNETCORE_ENVIRONMENT": "Development"
27
-      }
26
+      },
27
+      "applicationUrl": "http://localhost:5000"
28
     }
28
     }
29
   }
29
   }
30
 }
30
 }

+ 1
- 0
UnivateProperties_API/Repository/Properties/IPropertyRepository.cs Ver arquivo

11
         List<PropertyDisplay> GetDisplay(Func<Property, bool> where);
11
         List<PropertyDisplay> GetDisplay(Func<Property, bool> where);
12
         List<PropertyDisplay> GetDisplay(string Keyword);
12
         List<PropertyDisplay> GetDisplay(string Keyword);
13
         List<PropertyDisplay> GetDisplay(string type, string propertyType, string province, string city, string suburb, string propType);
13
         List<PropertyDisplay> GetDisplay(string type, string propertyType, string province, string city, string suburb, string propType);
14
+        List<PropertyType> GetPropertyTypes(Func<PropertyType, bool> where);
14
     }
15
     }
15
 }
16
 }

+ 17
- 1
UnivateProperties_API/Repository/Properties/PropertyRepository.cs Ver arquivo

19
 
19
 
20
         public List<Property> Get(Func<Property, bool> where)
20
         public List<Property> Get(Func<Property, bool> where)
21
         {
21
         {
22
-            return dBContext.Properties.Where(where).ToList();
22
+            return dBContext.Properties
23
+                .Include("PropertyType")
24
+                .Include("Province")
25
+                .Include("City")
26
+                .Include("Suburb")
27
+                .Where(where).ToList();
23
         }
28
         }
24
 
29
 
25
         public List<Property> GetAll()
30
         public List<Property> GetAll()
336
 
341
 
337
             return properties;
342
             return properties;
338
         }
343
         }
344
+
345
+        public List<PropertyType> GetPropertyTypes(Func<PropertyType, bool> where)
346
+        {
347
+            List<PropertyType> list;
348
+            if (where != null)
349
+                list = dBContext.PropertyTypes.Where(where).ToList();
350
+            else
351
+                list = dBContext.PropertyTypes.ToList();
352
+
353
+            return list;
354
+        }
339
     }
355
     }
340
 }
356
 }

+ 4
- 6
UnivateProperties_API/Repository/Users/IRegisterRepository.cs Ver arquivo

7
     public interface IRegisterRepository
7
     public interface IRegisterRepository
8
     {
8
     {
9
         User Authenticate(string username, string password);
9
         User Authenticate(string username, string password);
10
+        User Create(User user, string password, bool save);
11
+        Agency CreateAgency(AgencyDto agency);
12
+        void CreatePerson(UserDto individual, PersonType personType, bool save, Agency agency);
13
+        void Update(User userParam, string password = null);
10
         IEnumerable<User> GetAllUsers();
14
         IEnumerable<User> GetAllUsers();
11
         IEnumerable<Agency> GetAllAgencies();
15
         IEnumerable<Agency> GetAllAgencies();
12
         IEnumerable<Individual> GetAllIndividuals();
16
         IEnumerable<Individual> GetAllIndividuals();
13
         User GetById(int id);
17
         User GetById(int id);
14
         Agency GetByAgencyId(int id);
18
         Agency GetByAgencyId(int id);
15
         Individual GetByIndividualId(int id);
19
         Individual GetByIndividualId(int id);
16
-        User Create(User user, string password, bool save);
17
-        Agency CreateAgency(AgencyDto agency);
18
-        void CreatePerson(UserDto individual, PersonType personType, bool save, Agency agency);
19
-        void Update(User user, string password = null);
20
-        void UpdateAgency(Agency agency, string agencyname = null);
21
-        void UpdatePerson(Person person, PersonType personType);
22
         void Delete(int id);
20
         void Delete(int id);
23
         void DeleteAgency(int id);
21
         void DeleteAgency(int id);
24
         void DeleteIndividual(int id);
22
         void DeleteIndividual(int id);

+ 1
- 0
UnivateProperties_API/Repository/Users/IndividualRepository.cs Ver arquivo

76
             Save();
76
             Save();
77
         }
77
         }
78
 
78
 
79
+        //Updates in DB
79
         public void Update(Individual item)
80
         public void Update(Individual item)
80
         {
81
         {
81
             _dbContext.Entry(item).State = EntityState.Modified;
82
             _dbContext.Entry(item).State = EntityState.Modified;

+ 0
- 40
UnivateProperties_API/Repository/Users/RegisterRepository.cs Ver arquivo

150
             }
150
             }
151
         }
151
         }
152
 
152
 
153
-        public void UpdatePerson(Person person, PersonType personType)
154
-        {
155
-            if (personType == PersonType.Agent)
156
-            {
157
-                var item = (person as Agent);
158
-                _dbContext.Entry(item).State = EntityState.Modified;
159
-                Save();
160
-            }
161
-            else if (personType == PersonType.Individual)
162
-            {
163
-                var item = (person as Individual);
164
-                _dbContext.Entry(item).State = EntityState.Modified;
165
-                Save();
166
-            }
167
-        }
168
-
169
         public void Update(User userParam, string password = null)
153
         public void Update(User userParam, string password = null)
170
         {
154
         {
171
             var user = _dbContext.Users.Find(userParam.Id);
155
             var user = _dbContext.Users.Find(userParam.Id);
199
             _dbContext.SaveChanges();
183
             _dbContext.SaveChanges();
200
         }
184
         }
201
 
185
 
202
-        public void UpdateAgency(Agency agencyParam, string agencyname = null)
203
-        {
204
-            var agency = _dbContext.Agencies.Find(agencyParam.Id);
205
-
206
-            if (agency == null)
207
-                throw new AppException("Agency not found");
208
-
209
-            if (agencyParam.AgencyName != agency.AgencyName)
210
-            {
211
-                // username has changed so check if the new username is already taken
212
-                if (_dbContext.Agencies.Any(x => x.AgencyName == agencyParam.AgencyName))
213
-                    throw new AppException("AgencyName " + agencyParam.AgencyName + " is already taken");
214
-            }
215
-
216
-            // update user properties
217
-            agency.AgencyName = agencyParam.AgencyName;
218
-            agency.EAABEFFCNumber = agencyParam.EAABEFFCNumber;
219
-            agency.CompanyRegNumber = agencyParam.CompanyRegNumber;
220
-
221
-            // update password if it was entered
222
-            _dbContext.Agencies.Update(agency);
223
-            _dbContext.SaveChanges();
224
-        }
225
-
226
         [Authorize(Roles = Role.SuperAdmin)]
186
         [Authorize(Roles = Role.SuperAdmin)]
227
         public IEnumerable<User> GetAllUsers()
187
         public IEnumerable<User> GetAllUsers()
228
         {
188
         {

+ 49
- 3
UnivateProperties_API/Repository/Users/UserRepository.cs Ver arquivo

8
 using System.Security.Claims;
8
 using System.Security.Claims;
9
 using System.Text;
9
 using System.Text;
10
 using UnivateProperties_API.Context;
10
 using UnivateProperties_API.Context;
11
+using UnivateProperties_API.Helpers;
11
 using UnivateProperties_API.Model.Users;
12
 using UnivateProperties_API.Model.Users;
12
 
13
 
13
 namespace UnivateProperties_API.Repository.Users
14
 namespace UnivateProperties_API.Repository.Users
81
             Save();
82
             Save();
82
         }
83
         }
83
 
84
 
84
-        public void Update(User item)
85
+        //public void Update(User item)
86
+        //{
87
+        //    _dbContext.Entry(item).State = EntityState.Modified;
88
+        //    Save();
89
+        //}
90
+
91
+        public void Update(User userParam)
85
         {
92
         {
86
-            _dbContext.Entry(item).State = EntityState.Modified;
87
-            Save();
93
+            var user = _dbContext.Users.Find(userParam.Id);
94
+
95
+            if (user == null)
96
+                throw new AppException("User not found");
97
+
98
+            if (userParam.Username != user.Username)
99
+            {
100
+                // username has changed so check if the new username is already taken
101
+                if (_dbContext.Users.Any(x => x.Username == userParam.Username))
102
+                    throw new AppException("Username " + userParam.Username + " is already taken");
103
+            }
104
+
105
+            // update user properties
106
+            user.Name = userParam.Name;
107
+            user.Surname = userParam.Surname;
108
+            user.Username = userParam.Username;
109
+
110
+            // update password if it was entered
111
+            if (!string.IsNullOrWhiteSpace(userParam.PasswordHash.ToString()))
112
+            {
113
+                byte[] passwordHash, passwordSalt;
114
+                CreatePasswordHash(userParam.PasswordHash.ToString(), out passwordHash, out passwordSalt);
115
+
116
+                user.PasswordHash = passwordHash;
117
+                user.PasswordSalt = passwordSalt;
118
+            }
119
+
120
+            _dbContext.Users.Update(user);
121
+            _dbContext.SaveChanges();
122
+        }
123
+
124
+        private static void CreatePasswordHash(string password, out byte[] passwordHash, out byte[] passwordSalt)
125
+        {
126
+            if (password == null) throw new ArgumentNullException("password");
127
+            if (string.IsNullOrWhiteSpace(password)) throw new ArgumentException("Value cannot be empty or whitespace only string.", "password");
128
+
129
+            using (var hmac = new System.Security.Cryptography.HMACSHA512())
130
+            {
131
+                passwordSalt = hmac.Key;
132
+                passwordHash = hmac.ComputeHash(System.Text.Encoding.UTF8.GetBytes(password));
133
+            }
88
         }
134
         }
89
 
135
 
90
         public void Save()
136
         public void Save()

+ 0
- 2
UnivateProperties_API/UnivateProperties_API.csproj Ver arquivo

6
   </PropertyGroup>
6
   </PropertyGroup>
7
 
7
 
8
   <ItemGroup>
8
   <ItemGroup>
9
-    <Compile Remove="Migrations\20190826105340_InitialCreate.cs" />
10
-    <Compile Remove="Migrations\20190826105340_InitialCreate.Designer.cs" />
11
     <Compile Remove="Model\Users\AgencyAgent.cs" />
9
     <Compile Remove="Model\Users\AgencyAgent.cs" />
12
   </ItemGroup>
10
   </ItemGroup>
13
 
11
 

+ 1
- 1
UnivateProperties_API/appsettings.json Ver arquivo

9
   },
9
   },
10
   "AllowedHosts": "*",
10
   "AllowedHosts": "*",
11
   "ConnectionStrings": {
11
   "ConnectionStrings": {
12
-    "DefaultConnection": "Server=localhost;Port=5432;Database=Univate;User Id=postgres;Password=prov1s1on;"
12
+    "DefaultConnection": "Server=localhost;Port=5432;Database=Univate;User Id=postgres;Password=Prov1s1on;"
13
   }
13
   }
14
 }
14
 }

Carregando…
Cancelar
Salvar