Top "Custom-attributes" questions

In .NET Framework, custom attributes are user defined attributes which enable providing metadata for application elements such as assemblies, classes and methods.

Adding custom property attributes in Entity Framework code

Is there any way to add custom attributes to properties in EF generated code? The only thing I can see …

entity-framework custom-attributes
Lambda expression in attribute constructor

I have created an Attribute class called RelatedPropertyAttribute: [AttributeUsage(AttributeTargets.Property)] public class RelatedPropertyAttribute: Attribute { public string RelatedProperty { get; private …

c# .net reflection attributes custom-attributes
Attributes and Named/Optional constructor parameters not working

I have custom attribute defined like so: [AttributeUsage(AttributeTargets.Field)] public class EnumDisplayAttribute : Attribute { public string Description { get; private set; } …

c# custom-attributes
Understanding the $.validator.unobtrusive.adapters.addBool() method

I'm trying to understand something. From this blogpost http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-validation.html Bridging HTML and jQuery …

jquery jquery-validate asp.net-mvc-4 custom-attributes unobtrusive-validation
Is it possible to have a delegate as attribute parameter?

Is it possible to have a delegate as the parameter of an attribute? Like this: public delegate IPropertySet ConnectionPropertiesDelegate(); public …

c# delegates custom-attributes
How to add 'pass parameter' to custom AuthorizeAttribute

I want to secure controller action so that only users with role "Admin" can get in. I don't use Role/…

c# asp.net-mvc asp.net-mvc-3 custom-attributes
Change custom attribute's parameter at runtime

I need change attribute's parameter during runtime. I simplified my problem to simple example. Attribute class: [AttributeUsage(AttributeTargets.Property)] public …

c# reflection runtime custom-attributes
What are the similarities and differences between Java Annotations and C# Attributes?

I have a Java library I'm considering porting to C#. The Java library makes extensive use of annotations (at both …

c# java attributes annotations custom-attributes
Using an array reference as an XML attribute for custom android view

This problem has been solved, see comments for details. I am extending an existing Android View and loading some custom …

android custom-attributes android-xml android-custom-view
Retrieve custom attribute parameter values?

if i have created an attribute: public class TableAttribute : Attribute { public string HeaderText { get; set; } } which i apply to a …

c# custom-attributes