Click here to Skip to main content
15,912,329 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

i am getting warning error on adding new interfaces
i.e.
Field sbj_p is never assigned to ,and will always have its default value for string.

public interface interf
    {
        String Sbj { get; set; }
        
    }
    public class login : interf
    {
        private String sbj_p;
        
        
        public string Sbj
        {
            get
            {
                return sbj_p;
            }
            set
            {
                value = sbj_p;
            }
        }
}


What I have tried:

Its working for other interface.On Adding some new interfaces, it is throwing this warning. Due to this ,it is getting the default value of NULL and not taking the value that i am trying to passe it through textbox.text

Please help me out

thanks in Advance
Posted
Updated 20-Jun-18 5:11am
v2
Comments
F-ES Sitecore 20-Jun-18 10:44am    
Where does "Sbj_id" come into this?
Aksh@169 20-Jun-18 10:55am    
its sbj_p interface property

1 solution

set
{
    value = sbj_p;
}


should be

set
{
    sbj_p = value;
}


You can also delete the private sbj_p variable and just use this

public string Sbj { get; set; }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900