EDN Admin
Well-known member
<p align=left><font face=Arial size=2><font color="#ff0000 Error 1 Inconsistent accessibility: parameter type Interface_Sample.IMemberProfile is less accessible than method Interface_Sample.Form1.RetrieveMemberProfile(Interface_Sample.IMemberProfile) </font> </font>
<p align=left><font face=Arial color="#0000ff" size=2> how do I correct this error for the line in red below given IMemberProfile and class MemberProfile below? g </font> <font color="#0000ff" size=2>
<p align=left>
<div class=codeseg>
<div class=codecontent>
<div class=codesniptitle><span style="width:100% Code Snippet <font color="#0000ff" size=2>
<p align=left>namespace</font><font size=2> Interface_Sample
<p align=left>{
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>partial</font><font size=2> </font><font color="#0000ff" size=2>class</font><font size=2> </font><font color="#2b91af" size=2>Form1</font><font size=2> : </font><font color="#2b91af" size=2>Form </font><font size=2>
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> Form1()
<p align=left> {
<p align=left> InitializeComponent();
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>static</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> <font color="#ff0000 RetrieveMemberProfile</font><font color="#ff0000 (</font> </font><font color="#ff0000" size=2> IMemberProfile </font><font size=2><font color="#ff0000 Profile) </font>
<p align=left> {
<p align=left> Profile.FirstName = </font><font color="#a31515" size=2>"John"</font><font size=2>;
<p align=left> Profile.LastName = </font><font color="#a31515" size=2>"Doe"</font><font size=2>;
<p align=left> Profile.Email = </font><font color="#a31515" size=2>"jdoe@email.com"</font><font size=2>;
<p align=left> Profile.MemberID =
<p align=left></font><font color="#0000ff" size=2> new</font><font size=2> System.</font><font color="#2b91af" size=2>Guid </font><font size=2>
<p align=left> (</font><font color="#a31515" size=2>"{65C38236-CA96-4FF1-9142-00873B8BD333}"</font><font size=2>);
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>static</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> UpdateMemberProfile(</font><font color="#2b91af" size=2>IMemberProfile</font><font size=2> Profile)
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> _FirstName;
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> _LastName;
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> _Email;
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> _MemberID;
<p align=left> _FirstName = Profile.FirstName;
<p align=left> _LastName = Profile.LastName;
<p align=left> _Email = Profile.Email;
<p align=left> _MemberID = Profile.MemberID.ToString();
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> private</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> Form1_Load(</font><font color="#0000ff" size=2>object</font><font size=2> sender, </font><font color="#2b91af" size=2>EventArgs</font><font size=2> e)
<p align=left> {
<p align=left> BusinessRules.RetrieveMemberProfile(</font><font color="#0000ff" size=2>this</font><font size=2>);
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> private</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> btnUpdate_Click(</font><font color="#0000ff" size=2>object</font><font size=2> sender, </font><font color="#2b91af" size=2>EventArgs</font><font size=2> e)
<p align=left> {
<p align=left> BusinessRules.UpdateMemberProfile(</font><font color="#0000ff" size=2>this</font><font size=2>);
<p align=left> }
<p align=left> }
<p align=left>} </font>
<p align=left>
<p align=left> </font>
<font size=2>
<p align=left> </font>
<p align=left><font color="#0000ff" size=2>
<div class=codeseg>
<div class=codecontent>
<div class=codesniptitle><span style="width:100% Code Snippet <font color="#0000ff" size=2>
<p align=left>using</font><font size=2> System; </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2> System.Collections.Generic; </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2> System.Linq; </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2> System.Text;</font>
<p align=left><font size=2> </font><font color="#0000ff" size=2>
<p align=left>namespace</font><font size=2> Interface_Sample
<p align=left>{
<p align=left></font><font color="#0000ff" size=2> interface</font><font size=2> </font><font color="#2b91af" size=2>IMemberProfile </font><font size=2>
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> </font><font size=2>FirstName { </font><font color="#0000ff" size=2>get</font><font size=2>; </font><font color="#0000ff" size=2>set</font><font size=2>; }
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> LastName { </font><font color="#0000ff" size=2>get</font><font size=2>; </font><font color="#0000ff" size=2>set</font><font size=2>; }
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> Email { </font><font color="#0000ff" size=2>get</font><font size=2>; </font><font color="#0000ff" size=2>set</font><font size=2>; }
<p align=left> System.</font><font color="#2b91af" size=2>Guid</font><font size=2> MemberID { </font><font color="#0000ff" size=2>get</font><font size=2>; </font><font color="#0000ff" size=2>set</font><font size=2>; }
<p align=left> }
<p align=left>}</font>
<p align=left> </font>
<font size=2></font><font color="#0000ff" size=2>
<p align=left><font color="#0000ff" size=2>
<p align=left>
<div class=codeseg>
<div class=codecontent>
<div class=codesniptitle><span style="width:100% Code Snippet <font color="#0000ff" size=2>
<p align=left>using</font><font size=2><font color="#000000 System;</font> </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2><font color="#000000 System.Collections.Generic;</font> </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2><font color="#000000 System.Linq;</font> </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2><font color="#000000 System.Text;</font> </font><font color="#0000ff" size=2>
<p align=left>namespace</font><font size=2><font color="#000000 Interface_Sample</font>
<p align=left>{
<p align=left></font><font color="#0000ff" size=2> class</font><font size=2> </font><font color="#2b91af" size=2>MemberProfile</font><font size=2>: </font><font color="#2b91af" size=2>IMemberProfile </font><font size=2>
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>string</font><font size=2> FirstName
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> get</font><font size=2> { </font><font color="#0000ff" size=2>return</font><font size=2> txtFirstName.Text; }
<p align=left></font><font color="#0000ff" size=2> set</font><font size=2> { txtFirstName.Text = </font><font color="#0000ff" size=2>value</font><font size=2>; }
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>string</font><font size=2> LastName
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> get</font><font size=2> { </font><font color="#0000ff" size=2>return</font><font size=2> txtLastName.Text; }
<p align=left></font><font color="#0000ff" size=2> set</font><font size=2> { txtLastName.Text = </font><font color="#0000ff" size=2>value</font><font size=2>; }
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>string</font><font size=2> Email
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> get</font><font size=2> { </font><font color="#0000ff" size=2>return</font><font size=2> txtEmail.Text; }
<p align=left></font><font color="#0000ff" size=2> set</font><font size=2> { txtEmail.Text = </font><font color="#0000ff" size=2>value</font><font size=2>; }
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> System.</font><font color="#2b91af" size=2>Guid</font><font size=2> MemberID
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> get </font><font size=2>
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> if</font><font size=2> (m_uniqueID.CompareTo(</font><font color="#0000ff" size=2>null</font><font size=2>) == 0)
<p align=left> {
<p align=left> m_uniqueID = System.</font><font color="#2b91af" size=2>Guid</font><font size=2>.NewGuid();
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> return</font><font size=2> m_uniqueID;
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> set </font><font size=2>
<p align=left> {
<p align=left> m_uniqueID = </font><font color="#0000ff" size=2>value</font><font size=2>;
<p align=left> }
<p align=left> }
<p align=left> }
<p align=left>} </font>
<p align=left>
<p align=left> </font>
<font size=2></font>
<p align=left>
<p align=left>
<p align=left>
<p align=left> </font>
<font size=2>
<p align=left> </font>
View the full article
<p align=left><font face=Arial color="#0000ff" size=2> how do I correct this error for the line in red below given IMemberProfile and class MemberProfile below? g </font> <font color="#0000ff" size=2>
<p align=left>
<div class=codeseg>
<div class=codecontent>
<div class=codesniptitle><span style="width:100% Code Snippet <font color="#0000ff" size=2>
<p align=left>namespace</font><font size=2> Interface_Sample
<p align=left>{
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>partial</font><font size=2> </font><font color="#0000ff" size=2>class</font><font size=2> </font><font color="#2b91af" size=2>Form1</font><font size=2> : </font><font color="#2b91af" size=2>Form </font><font size=2>
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> Form1()
<p align=left> {
<p align=left> InitializeComponent();
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>static</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> <font color="#ff0000 RetrieveMemberProfile</font><font color="#ff0000 (</font> </font><font color="#ff0000" size=2> IMemberProfile </font><font size=2><font color="#ff0000 Profile) </font>
<p align=left> {
<p align=left> Profile.FirstName = </font><font color="#a31515" size=2>"John"</font><font size=2>;
<p align=left> Profile.LastName = </font><font color="#a31515" size=2>"Doe"</font><font size=2>;
<p align=left> Profile.Email = </font><font color="#a31515" size=2>"jdoe@email.com"</font><font size=2>;
<p align=left> Profile.MemberID =
<p align=left></font><font color="#0000ff" size=2> new</font><font size=2> System.</font><font color="#2b91af" size=2>Guid </font><font size=2>
<p align=left> (</font><font color="#a31515" size=2>"{65C38236-CA96-4FF1-9142-00873B8BD333}"</font><font size=2>);
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>static</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> UpdateMemberProfile(</font><font color="#2b91af" size=2>IMemberProfile</font><font size=2> Profile)
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> _FirstName;
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> _LastName;
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> _Email;
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> _MemberID;
<p align=left> _FirstName = Profile.FirstName;
<p align=left> _LastName = Profile.LastName;
<p align=left> _Email = Profile.Email;
<p align=left> _MemberID = Profile.MemberID.ToString();
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> private</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> Form1_Load(</font><font color="#0000ff" size=2>object</font><font size=2> sender, </font><font color="#2b91af" size=2>EventArgs</font><font size=2> e)
<p align=left> {
<p align=left> BusinessRules.RetrieveMemberProfile(</font><font color="#0000ff" size=2>this</font><font size=2>);
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> private</font><font size=2> </font><font color="#0000ff" size=2>void</font><font size=2> btnUpdate_Click(</font><font color="#0000ff" size=2>object</font><font size=2> sender, </font><font color="#2b91af" size=2>EventArgs</font><font size=2> e)
<p align=left> {
<p align=left> BusinessRules.UpdateMemberProfile(</font><font color="#0000ff" size=2>this</font><font size=2>);
<p align=left> }
<p align=left> }
<p align=left>} </font>
<p align=left>
<p align=left> </font>
<font size=2>
<p align=left> </font>
<p align=left><font color="#0000ff" size=2>
<div class=codeseg>
<div class=codecontent>
<div class=codesniptitle><span style="width:100% Code Snippet <font color="#0000ff" size=2>
<p align=left>using</font><font size=2> System; </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2> System.Collections.Generic; </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2> System.Linq; </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2> System.Text;</font>
<p align=left><font size=2> </font><font color="#0000ff" size=2>
<p align=left>namespace</font><font size=2> Interface_Sample
<p align=left>{
<p align=left></font><font color="#0000ff" size=2> interface</font><font size=2> </font><font color="#2b91af" size=2>IMemberProfile </font><font size=2>
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> </font><font size=2>FirstName { </font><font color="#0000ff" size=2>get</font><font size=2>; </font><font color="#0000ff" size=2>set</font><font size=2>; }
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> LastName { </font><font color="#0000ff" size=2>get</font><font size=2>; </font><font color="#0000ff" size=2>set</font><font size=2>; }
<p align=left></font><font color="#0000ff" size=2> string</font><font size=2> Email { </font><font color="#0000ff" size=2>get</font><font size=2>; </font><font color="#0000ff" size=2>set</font><font size=2>; }
<p align=left> System.</font><font color="#2b91af" size=2>Guid</font><font size=2> MemberID { </font><font color="#0000ff" size=2>get</font><font size=2>; </font><font color="#0000ff" size=2>set</font><font size=2>; }
<p align=left> }
<p align=left>}</font>
<p align=left> </font>
<font size=2></font><font color="#0000ff" size=2>
<p align=left><font color="#0000ff" size=2>
<p align=left>
<div class=codeseg>
<div class=codecontent>
<div class=codesniptitle><span style="width:100% Code Snippet <font color="#0000ff" size=2>
<p align=left>using</font><font size=2><font color="#000000 System;</font> </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2><font color="#000000 System.Collections.Generic;</font> </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2><font color="#000000 System.Linq;</font> </font><font color="#0000ff" size=2>
<p align=left>using</font><font size=2><font color="#000000 System.Text;</font> </font><font color="#0000ff" size=2>
<p align=left>namespace</font><font size=2><font color="#000000 Interface_Sample</font>
<p align=left>{
<p align=left></font><font color="#0000ff" size=2> class</font><font size=2> </font><font color="#2b91af" size=2>MemberProfile</font><font size=2>: </font><font color="#2b91af" size=2>IMemberProfile </font><font size=2>
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>string</font><font size=2> FirstName
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> get</font><font size=2> { </font><font color="#0000ff" size=2>return</font><font size=2> txtFirstName.Text; }
<p align=left></font><font color="#0000ff" size=2> set</font><font size=2> { txtFirstName.Text = </font><font color="#0000ff" size=2>value</font><font size=2>; }
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>string</font><font size=2> LastName
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> get</font><font size=2> { </font><font color="#0000ff" size=2>return</font><font size=2> txtLastName.Text; }
<p align=left></font><font color="#0000ff" size=2> set</font><font size=2> { txtLastName.Text = </font><font color="#0000ff" size=2>value</font><font size=2>; }
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> </font><font color="#0000ff" size=2>string</font><font size=2> Email
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> get</font><font size=2> { </font><font color="#0000ff" size=2>return</font><font size=2> txtEmail.Text; }
<p align=left></font><font color="#0000ff" size=2> set</font><font size=2> { txtEmail.Text = </font><font color="#0000ff" size=2>value</font><font size=2>; }
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> public</font><font size=2> System.</font><font color="#2b91af" size=2>Guid</font><font size=2> MemberID
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> get </font><font size=2>
<p align=left> {
<p align=left></font><font color="#0000ff" size=2> if</font><font size=2> (m_uniqueID.CompareTo(</font><font color="#0000ff" size=2>null</font><font size=2>) == 0)
<p align=left> {
<p align=left> m_uniqueID = System.</font><font color="#2b91af" size=2>Guid</font><font size=2>.NewGuid();
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> return</font><font size=2> m_uniqueID;
<p align=left> }
<p align=left></font><font color="#0000ff" size=2> set </font><font size=2>
<p align=left> {
<p align=left> m_uniqueID = </font><font color="#0000ff" size=2>value</font><font size=2>;
<p align=left> }
<p align=left> }
<p align=left> }
<p align=left>} </font>
<p align=left>
<p align=left> </font>
<font size=2></font>
<p align=left>
<p align=left>
<p align=left>
<p align=left> </font>
<font size=2>
<p align=left> </font>
View the full article