data-annotations

Can't create datasets and load images in COCO annotator

故事扮演 提交于 2021-01-28 03:25:35
问题 I'm trying to annotate images with COCO key points for pose estimation using https://github.com/jsbroks/coco-annotator. As described in the Installation section I cloned the repo. I installed Docker and Docker-compose. Following this I started the container with $ docker-compose up and it is running. I am now on the website https://annotator.justinbrooks.ca/, I created one user and datasets but they do not appear in the repo datasets/ folder. I tried to create them manually and to load images

Entity Framework 6 creates Id column even though other primary key is defined

守給你的承諾、 提交于 2021-01-27 05:31:16
问题 I defined a DataObject as: public class SensorType : EntityData { //PKs public string CompanyId { get; set; } public string ServiceId { get; set; } public string Type { get; set; } } And used fluent API to make CompanyId and ServiceId a composite key: modelBuilder.Entity<SensorType>() .HasKey(t => new { t.CompanyId, t.ServiceId }); //No autogeneration of PKs modelBuilder.Entity<SensorType>().Property(t => t.ServiceId) .HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema

Entity Framework 6 creates Id column even though other primary key is defined

ぐ巨炮叔叔 提交于 2021-01-27 05:30:42
问题 I defined a DataObject as: public class SensorType : EntityData { //PKs public string CompanyId { get; set; } public string ServiceId { get; set; } public string Type { get; set; } } And used fluent API to make CompanyId and ServiceId a composite key: modelBuilder.Entity<SensorType>() .HasKey(t => new { t.CompanyId, t.ServiceId }); //No autogeneration of PKs modelBuilder.Entity<SensorType>().Property(t => t.ServiceId) .HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema

In asp.net core, are empty string converted to NULL?

半腔热情 提交于 2021-01-01 04:41:44
问题 Assuming I have a form , and the value of "" is selected when the form is sent from the view to the controller to the action method , will asp.net core convert the empty string to a NULL value? If I do not make the Boolean property nullable for the [required] attribute, it gives me this error: The value '' is invalid. Does this mean that: "" is evaluated as NULL , the Boolean property does not allow NULL , asp.net core returns a error saying that you can not pass a empty string to the Model

In asp.net core, are empty string converted to NULL?

混江龙づ霸主 提交于 2021-01-01 04:38:52
问题 Assuming I have a form , and the value of "" is selected when the form is sent from the view to the controller to the action method , will asp.net core convert the empty string to a NULL value? If I do not make the Boolean property nullable for the [required] attribute, it gives me this error: The value '' is invalid. Does this mean that: "" is evaluated as NULL , the Boolean property does not allow NULL , asp.net core returns a error saying that you can not pass a empty string to the Model

Url validation attribute marks `localhost` as invalid Url

旧街凉风 提交于 2020-07-18 21:06:16
问题 In our ASP.MVC project we are using DataAnnotations attributes for validation. One of the fields should contains Url and it is marked with [Url] attribute. But if I put http://localhost:13030 into the field value it isn't passing the validation. Is there any way to use the attribute to define localhost as a valid target? 回答1: UrlAttribute validates against the RegEx shown in the source code here: https://github.com/Microsoft/referencesource/blob/master/System.ComponentModel.DataAnnotations

Url validation attribute marks `localhost` as invalid Url

孤街醉人 提交于 2020-07-18 21:05:24
问题 In our ASP.MVC project we are using DataAnnotations attributes for validation. One of the fields should contains Url and it is marked with [Url] attribute. But if I put http://localhost:13030 into the field value it isn't passing the validation. Is there any way to use the attribute to define localhost as a valid target? 回答1: UrlAttribute validates against the RegEx shown in the source code here: https://github.com/Microsoft/referencesource/blob/master/System.ComponentModel.DataAnnotations

ASP.NET MVC data annotations attribute Range set from another property value

萝らか妹 提交于 2020-07-05 02:52:41
问题 Hi I have following in my Asp.net MVc Model TestModel.cs public class TestModel { public double OpeningAmount { get; set; } [Required(ErrorMessage="Required")] [Display(Name = "amount")] [Range(0 , double.MaxValue, ErrorMessage = "The value must be greater than 0")] public string amount { get; set; } } Now from my controller "OpeningAmount " is assign . Finaly when I submit form I want to check that "amount" must be greater than "OpeningAmonut" . so want to set Range dynamically like [Range

The specified value does not conform to the required format yyyy-MM-dd

怎甘沉沦 提交于 2020-05-19 08:28:42
问题 I have a .Net MVC 5 application that is using Data Annotations, Entity-Framework Jquery 2.1.3 and Jquery UI 1.11.4. When I render an edit form with an input of type date using the UK format "dd/MM/YYYY"; the following error message appears when using Google Chrome: The specified value '10/10/2001' does not conform to the required format, 'yyyy-MM-dd'. jquery-2.1.3.js:5317 Model public class MyModel { [Column(TypeName = "date"), DataType(DataType.Date), Display(Name = "My date")]