In database-first approach since there is an existing database., The entity classes are automatically created by edmx model.: If we use [MetadataType(typeof(ConceptMetadataSource))] to attach a MetadataSource file which contains all the data annotations like [HiddenInput(DisplayValue = false)] or [Display(Name = "Title")]. The data annotations will be wiped out each time the entity classes are regenerated as the code will be regenerated once we modify a table in the database Solution: All you have to do is create another partial class and use Metadatatype attribute Create a metadata class in models as below… Create a Partial class for the metadata in models as below… The new partial class can be created in a different folder
Difference between GET and POST. Which one is more secure? GET and POST methods are used for the data transfer between the web pages. GET mainly used for small data which is not secure because in case of GET method, the data which we are passing will be visible in the url so we can't keep the secure data which will be visible in the url. There is also limited data which can be passed in case of GET method (max 255 character). POST is used for transferring the huge data between the pages where we can keep the secure data and can transfer it. In case of using the POST method, the data which is transferring between the pages will not be visible so it is more secure than the GET method. Also there is no limit for POST method to post the data to the next page. POST is more secure What are Razor engines? How is it diff from ASP Engines? A. RAZOR engine is the new concept in the MVC 3 which is mainly used to create the views in the MVC applications. It created the cshtml pages for...
Comments
Post a Comment