Questions tagged as 'attribute'

2
answers

Dynamic declaration in attribute property

As part of an ORM microplatform I'm developing, I'm defining a generic class that implements exclusively tight coupling (1 record x 1 object). public class Course : MicroEntity<Course> { public string fullname { get; set; } publ...
asked by 06.10.2015 / 19:56
1
answer

How to create a Custom Attribute?

For some time now I'm trying to understand the concept of custom attribute from C #. I think it kind of looks like Python's decorators system. But I'm not understanding very well. I gave a codeProject article , but not yet it was clear....
asked by 19.03.2016 / 23:43
2
answers

Get information stored in an "attribute"

In the ORM I use, classes are mapped using Attributes . I need to retrieve the value stored in them. Ex.: [Table("CADASTRO_CLIENTE")] public class Cliente { [Property("Id")] public int Id { get; set; } } Example usage (fiction...
asked by 11.12.2015 / 12:04
1
answer

Error in 1 to 1 relationship declaration in EF with code-first and attributes!

I have the following classes where I want to do a 1 to 1 relationship: User: [Table("Usuario")] public class Usuario { [Key] [DatabaseGenerated(DatabaseGeneratedOption.Identity)] public int Id { get; set; } [Required]...
asked by 01.07.2014 / 16:38
1
answer

Execute builder of an Attribute

How do I call the constructor of an attribute before the constructor of the decorated class? For example, I have my attribute: using System; namespace T.WinForm { public class TesteAttribute : Attribute { public TesteAtt...
asked by 11.05.2016 / 02:27
1
answer

How to add and remove required input with jQuery?

I have a select with two option , when I select the first option I want it to show me an input field strong> with the attribute and when I select the second option I want it to do the same, only removing the required input . The...
asked by 26.11.2016 / 23:36
1
answer

How do I inherit a value from a given attribute in CSS?

Hello, everyone. How do I inherit a value from a given attribute in CSS? Example: <div class="flex" id="1" style="line-height: 100px; height: 100px; background-color: red;">1</div> <div class="flex" id="1" style="line...
asked by 17.09.2018 / 15:03
1
answer

Is it possible to get a parent attribute where the class defines the child attribute?

Assuming I have the following hierarchy: [AttributeUsage(AttributeTargets.Property, AllowMultiple = false, Inherited = true)] public class GrandpaAttribute : Attribute { public GrandpaAttribute() {} } public class ParentAttribute() : Gran...
asked by 03.04.2018 / 17:06
1
answer

Select element by part of attribute contained in it

I have an element, for example: <div class="teste" data-info="isflaolatesteum"></div> And to select it, you could do it as follows: $(".teste[data-info='isflaolatesteum']")... However, I want to select this element through...
asked by 04.11.2015 / 23:59
0
answers

'str' object has no attribute biopython

I'm working with biopython. I ask the input of an input (): enz_name1 = input('ENZYME 1 NAME: ') enz_name2 = input('ENZYME 2 NAME: ') However, when I want to use input () to use the .catalyse option, like this: rb=RestrictionBatch()...
asked by 12.08.2018 / 14:39