Current filter:
                                You should refresh the page.
                                0
                                  • Hi,

                                    1.Standing in Attribute - add missing constrctor generates protected constrctor while the calss seal
                                       [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple= true )]
                                        public sealed class CodeReviewAttribute : Attribute
                                        {

                                            public CodeReviewAttribute(string name, DateTime date, bool isApproved)
                                            {
                                                Name = name;
                                                Date = date;
                                                IsApproved = isApproved;
                                                        
                                            }
                                               
                                         
                                             
                                            public string Name { get; private set; }
                                            public DateTime Date { get; private set; }
                                            public bool IsApproved { get; private set; }
                                        }

                                    2.Current results:
                                       [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple= true )]
                                        public sealed class CodeReviewAttribute : Attribute
                                        {

                                            public CodeReviewAttribute(string name, DateTime date, bool isApproved)
                                            {
                                                Name = name;
                                                Date = date;
                                                IsApproved = isApproved;
                                                        
                                            }
                                            protected CodeReviewAttribute()
                                            {
                                                
                                            }
                                             
                                                
                                         
                                             
                                            public string Name { get; private set; }
                                            public DateTime Date { get; private set; }
                                            public bool IsApproved { get; private set; }
                                        }

                                    3.Expected:
                                       [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple= true )]
                                        public sealed class CodeReviewAttribute : Attribute
                                        {

                                            public CodeReviewAttribute(string name, DateTime date, bool isApproved)
                                            {
                                                Name = name;
                                                Date = date;
                                                IsApproved = isApproved;
                                                        
                                            }
                                            public CodeReviewAttribute()
                                            {
                                                
                                            }
                                             
                                                 
                                         
                                             
                                            public string Name { get; private set; }
                                            public DateTime Date { get; private set; }
                                            public bool IsApproved { get; private set; }
                                        }

                                    Thanks,
                                    Daniel Shitrit

                                0

                                -:)

                                You must  log in  or  register  to leave an answer

                                Is your intention to post an answer to your own question?

                                • If so, then proceed.
                                • If you simply wanted to post additional information, ask for further clarification, or to just say "Thanks!", please click Leave a Comment.
                                • If you wish to edit your original question, please use the Edit button in the Toolbox at the top right corner of that entry.