TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Guest User
Tech Writer
2.1k
474.3k
Inconsistent accessibility parameter:RestAPi in C#
Oct 17 2020 4:36 AM
Hi Team
I need some help, i have a public class object(CoinJar) but the problem now it does not seem to find void AddCoin(coinType....) its throwing an error "inconsistent accessibility parameter. How do i resolve this issue?
//CoinJarController
[HttpPost]
void
AddCoin([FromBody]eCoinType coinType, [FromBody]
int
count = 1)
{
this
.coinJar.AddCoin(coinType, count);
//Inconsistent accessibility parameter.
}
//CoinJar.cs
public
class
CoinJar
{
private
readonly
Coins[] coins = Enum.GetValues(
typeof
(eCoinType)).Cast
().Select(t =>
new
Coins(t)).ToArray();
// default constructor.
public
CoinJar()
{
}
// Add method.
void
AddCoin(eCoinType coinType,
int
count = 1)
{
coins.First(t => t.CoinType == coinType).Amount += count;
}
}
Reply
Answers (
1
)
Create view from view model to show data from two table
Merge multiple xml files in one file